<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微信小程序图像处理原型演示</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }
        
        .phone-frame {
            max-width: 375px;
            height: 812px;
            background: #000;
            border-radius: 40px;
            margin: 0 auto;
            padding: 10px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.3);
            position: relative;
            overflow: hidden;
        }
        
        .screen {
            width: 100%;
            height: 100%;
            background: #f5f5f5;
            border-radius: 30px;
            overflow: hidden;
            position: relative;
        }
        
        .status-bar {
            height: 44px;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            font-size: 14px;
            font-weight: 600;
        }
        
        .content {
            height: calc(100% - 44px);
            overflow-y: auto;
            background: #fff;
        }
        
        .header {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 30px 20px;
            text-align: center;
        }
        
        .header h1 {
            font-size: 24px;
            margin-bottom: 8px;
        }
        
        .header p {
            opacity: 0.9;
            font-size: 14px;
        }
        
        .feature-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            padding: 20px;
        }
        
        .feature-card {
            background: white;
            border-radius: 15px;
            padding: 25px;
            text-align: center;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
            cursor: pointer;
        }
        
        .feature-card:hover {
            transform: translateY(-5px);
        }
        
        .feature-icon {
            font-size: 40px;
            margin-bottom: 10px;
        }
        
        .feature-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 5px;
        }
        
        .feature-desc {
            font-size: 12px;
            color: #666;
        }
        
        .demo-section {
            margin: 20px;
            padding: 20px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
        
        .demo-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: #333;
        }
        
        .demo-content {
            display: none;
        }
        
        .demo-content.active {
            display: block;
        }
        
        .image-container {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .image-box {
            flex: 1;
            text-align: center;
        }
        
        .image-box img {
            width: 100%;
            height: 120px;
            object-fit: cover;
            border-radius: 10px;
            margin-bottom: 5px;
        }
        
        .image-label {
            font-size: 12px;
            color: #666;
        }
        
        .controls {
            margin-bottom: 15px;
        }
        
        .slider-container {
            margin-bottom: 15px;
        }
        
        .slider-label {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
            font-size: 14px;
        }
        
        .slider {
            width: 100%;
            height: 4px;
            border-radius: 2px;
            background: #ddd;
            outline: none;
            -webkit-appearance: none;
        }
        
        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #667eea;
            cursor: pointer;
        }
        
        .button-group {
            display: flex;
            gap: 10px;
        }
        
        .btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: background 0.3s;
        }
        
        .btn-primary {
            background: #667eea;
            color: white;
        }
        
        .btn-secondary {
            background: #f0f0f0;
            color: #333;
        }
        
        .btn:hover {
            opacity: 0.9;
        }
        
        .grid-preview {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2px;
            margin-bottom: 15px;
        }
        
        .grid-item {
            aspect-ratio: 1;
            background: #f0f0f0;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: #666;
        }
        
        .grid-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 4px;
        }
        
        .nav-bar {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 83px;
            background: white;
            display: flex;
            border-top: 1px solid #eee;
        }
        
        .nav-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: #666;
            cursor: pointer;
        }
        
        .nav-item.active {
            color: #667eea;
        }
        
        .nav-icon {
            font-size: 20px;
            margin-bottom: 2px;
        }
        
        .stats {
            text-align: center;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 10px;
            margin: 20px;
        }
        
        .stats-number {
            font-size: 24px;
            font-weight: bold;
            color: #667eea;
        }
        
        .stats-label {
            font-size: 14px;
            color: #666;
            margin-top: 5px;
        }
    </style>
</head>
<body>
    <div class="phone-frame">
        <div class="screen">
            <div class="status-bar">
                <span>9:41</span>
                <span>📶 🔋</span>
            </div>
            
            <div class="content">
                <div class="header">
                    <h1>🎨 图像处理大师</h1>
                    <p>一站式图片处理工具</p>
                </div>
                
                <div class="stats">
                    <div class="stats-number">1,234</div>
                    <div class="stats-label">已处理图片</div>
                </div>
                
                <div class="feature-grid">
                    <div class="feature-card" onclick="showDemo('compress')">
                        <div class="feature-icon">📦</div>
                        <div class="feature-title">图片压缩</div>
                        <div class="feature-desc">智能压缩不失真</div>
                    </div>
                    
                    <div class="feature-card" onclick="showDemo('watermark')">
                        <div class="feature-icon">💧</div>
                        <div class="feature-title">添加水印</div>
                        <div class="feature-desc">文字/图片水印</div>
                    </div>
                    
                    <div class="feature-card" onclick="showDemo('convert')">
                        <div class="feature-icon">🔄</div>
                        <div class="feature-title">格式转换</div>
                        <div class="feature-desc">JPG/PNG互转</div>
                    </div>
                    
                    <div class="feature-card" onclick="showDemo('crop')">
                        <div class="feature-icon">✂️</div>
                        <div class="feature-title">图片裁剪</div>
                        <div class="feature-desc">自由/比例裁剪</div>
                    </div>
                </div>
                
                <div class="feature-card" onclick="showDemo('grid')" style="margin: 20px;">
                    <div class="feature-icon">📱</div>
                    <div class="feature-title">九宫格切图</div>
                    <div class="feature-desc">朋友圈九宫格神器</div>
                </div>
                
                <!-- 压缩演示 -->
                <div class="demo-section demo-content" id="compress-demo">
                    <div class="demo-title">📦 图片压缩演示</div>
                    <div class="image-container">
                        <div class="image-box">
                            <img src="" alt="原图">
                            <div class="image-label">原图 2.3MB</div>
                        </div>
                        <div class="image-box">
                            <img src="" alt="压缩图">
                            <div class="image-label">压缩后 567KB</div>
                        </div>
                    </div>
                    <div class="controls">
                        <div class="slider-container">
                            <div class="slider-label">
                                <span>压缩质量</span>
                                <span id="quality-value">80%</span>
                            </div>
                            <input type="range" class="slider" min="10" max="100" value="80" oninput="updateQuality(this.value)">
                        </div>
                        <div class="button-group">
                            <button class="btn btn-primary" onclick="compressImage()">开始压缩</button>
                            <button class="btn btn-secondary" onclick="saveImage()">保存图片</button>
                        </div>
                    </div>
                </div>
                
                <!-- 九宫格演示 -->
                <div class="demo-section demo-content" id="grid-demo">
                    <div class="demo-title">📱 九宫格切图演示</div>
                    <div class="grid-preview">
                        <div class="grid-item"><img src="" alt="1"></div>
                        <div class="grid-item"><img src="" alt="2"></div>
                        <div class="grid-item"><img src="" alt="3"></div>
                        <div class="grid-item"><img src="" alt="4"></div>
                        <div class="grid-item"><img src="" alt="5"></div>
                        <div class="grid-item"><img src="" alt="6"></div>
                        <div class="grid-item"><img src="" alt="7"></div>
                        <div class="grid-item"><img src="" alt="8"></div>
                        <div class="grid-item"><img src="" alt="9"></div>
                    </div>
                    <div class="button-group">
                        <button class="btn btn-primary" onclick="createGrid()">生成九宫格</button>
                        <button class="btn btn-secondary" onclick="saveAllGrid()">保存全部</button>
                    </div>
                </div>
            </div>
            
            <div class="nav-bar">
                <div class="nav-item active">
                    <div class="nav-icon">🏠</div>
                    <span>首页</span>
                </div>
                <div class="nav-item">
                    <div class="nav-icon">📁</div>
                    <span>相册</span>
                </div>
                <div class="nav-item">
                    <div class="nav-icon">⚙️</div>
                    <span>设置</span>
                </div>
            </div>
        </div>
    </div>

    <script>
        function showDemo(type) {
            // 隐藏所有演示
            document.querySelectorAll('.demo-content').forEach(el => el.classList.remove('active'));
            
            // 显示对应演示
            const demoEl = document.getElementById(type + '-demo');
            if (demoEl) {
                demoEl.classList.add('active');
                demoEl.scrollIntoView({ behavior: 'smooth' });
            }
        }
        
        function updateQuality(value) {
            document.getElementById('quality-value').textContent = value + '%';
        }
        
        function compressImage() {
            alert('🎉 压缩成功！\n原图: 2.3MB → 压缩后: 567KB\n压缩率: 75%');
        }
        
        function saveImage() {
            alert('📥 图片已保存到手机相册！');
        }
        
        function createGrid() {
            alert('🎯 九宫格生成成功！\n9张图片已准备就绪');
        }
        
        function saveAllGrid() {
            alert('📱 9张图片已全部保存到相册！\n快去朋友圈发九宫格吧～');
        }
        
        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            console.log('🎨 微信小程序原型已加载');
        });
    </script>
</body>
</html>